home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Archive Magazine CD 1995
/
Archive Magazine CD 1995.iso
/
text
/
hints
/
volume_01
/
issue_05
< prev
next >
Wrap
Text File
|
1995-02-16
|
12KB
|
342 lines
• Text files for BASIC. I always used to write my BASIC programs in
Wordwise and put an AUTO command as the top line then go into BASIC and
NEW and then *EXEC <filename>. But IÕve just discovered (what IÕm sure
you all knew already) that BASIC can do it for me. You donÕt have to put
AUTO at the top you just say *BASIC -LOAD <filename> and it will load
the text version of the program and put line numbers onto it. However,
as with the *EXEC technique, you cannot use long multi-statement lines
or you will get the “Line too long” error.
1.05
(One reader, who was using Arthur 0.2, found that text files longer than
32k got corrupted, but I tried it on my system with BASIC 1.02 and
Arthur 1.2 and it seemed OK.)
1.05
• Fast screen save. This is obviously something which a number of you
have been thinking about. I got a lot of response to my pleas for help.
Several of you gave ways of *SAVEing the screen information from the
appropriate bit of RAM and re-loading it there, though this obviously
will not bring with it the palette information or the correct mode. For
example:
1.05
DEF PROCscreensave(filename$)
1.05
LOCAL K%
1.05
CASE MODE OF
1.05
WHEN 0,1,4,5,6 : K%=20
1.05
WHEN 2,3,8,9,11,18 : K%=40
1.05
WHEN 7,10,12,13,14,19 : K%=80
1.05
WHEN 16,17 : K%=132
1.05
WHEN 15,20 : K%=160
1.05
ENDCASE
1.05
!&80=149:!&84=-1
1.05
SYS 49,&80,&88 : REM OS_ReadVduVariables
1.05
OSCLI“SAVE ”+filename$+“ ”+STR$
1.05
~(!&88)+“ +”+STR$~(K%*1024)
1.05
ENDPROC
1.05
This takes only a second or two to save the screen. It can be reloaded
by typing *LOAD filename. The program saves the whole screen, not just
the graphics window. You must not have scrolled the screen prior to
saving or re-loading, but a CLS before re-loading will cancel the
scrolling. Also, you must be in the right mode for the screen you are
about to load and you need to have the same screen colour definitions
set up.
1.05
What we have been promised though is a module, which we hope to publish
next month, which will give you legal *commands (or SWIs) for loading
and saving screen information including palette and mode and you will
find that it is several times faster than the existing SCREENSAVE
routines.
1.05
• Extra help on BASICÉ (OS1.2) If you type *BASIC -help<return> you
get a bit more help information about BASIC. (But does anyone know what
the last two bits refer to? i.e. what is an “in-core” program? Does it
mean you can have more than one program in memory?)
1.05
• ADFS: If you name all your discs with *NAMEDISC, the Archimedes will
remember the previously mounted discs. So, for example, if you put in a
disc called TESTING and you *MOUNT it and then put in a disc called
BASICPROGS and *MOUNT that, you can then see the directory of TESTING
without putting the disc back in again. All you do is type *MOUNT
TESTING and you can *CAT it. If you then want to look at the disc that
is in the drive, you will of course have to *MOUNT again. The only
problem occurs when you have backup discs because they will have the
same name — this gives “Ambiguous disc name”.
1.05
• Sprite Editor. “To create a new spriteÉ” It took me ages to find out
how to create a new sprite. The manual tells you to click on the
“Create” box and “you are then prompted for a name and a mode”. I was
expecting a prompt something like: “Please enter name:”. I saw the words
“Create sprite” appear at the bottom of the screen and assumed it wanted
some sort of confirmation that that was what I wanted to do, but
whatever I did, the words disappeared again! In fact that is the actual
prompt that the manual was referring to! All you do is type in the new
name and press <return>. You would have thought they could have put in a
more obvious prompt than that — or maybe just switched on the cursor to
indicate that it was time to type something rather than click on the
mouse buttons, but perhaps I have been spoiled by using the Apple Mac
where prompts are rather more obvious and logical! Huhh!
1.05
• Reading the catalogue. An easier way to read the contents of a
catalogue, rather than reading it off the screen (see Gus GemÕs article
last month) is to use SYS “OS_GBPB” as followsÉ
1.05
DIM C% 999
1.05
!&80=&2A00
1.05
SYS “OS_GBPB”,9,&80,C%,999,0,
1.05
999 TO ,,,ENTRIES
1.05
This stores the filenames and sub-directories of the current directory
at the address C%, in alphabetical order and each terminated by a zero
byte. The number of entries is stored in the BASIC variable ENTRIES.
1.05
• Neater than OSCLIÉ SYS 6 (equivalent of FX calls) is much neater
than using OSCLIs: e.g. Matthew TreagusÕ screen bank switching would
look neater if, instead of using OSCLI (“FX112,”+STR$N%) he had used SYS
6,112,N%. If you donÕt like the anonymity of SYS 6, you can use SYS
“OS_Byte”,112,N%. (See GeraldÕs article on page 12.)
1.05
• BeebugÕs Masterfile can be made to work on the Archimedes without
using the emulator — it just needs a very few modifications — contact
DrÊÊPeter Catermole at Winchester College, Kingsgate Road, Winchester,
SO23 9PG.
1.05
• BBC ROMs — Continuing the saga of poking various bytes to get BBC
ROMs to work under the emulator, View B3.0 should apparently have A8A1,
2 and 3 poked to &EA and Viewspell 1.0, &820F, 8210 and 8211 likewise.
1.05
• When setting the clock, the setting box sometimes covers the face of
the clock, so point at the bottom right hand corner of the clock box and
then press the middle mouse button.
1.05
• Plugging modules in and out. ItÕs all very well to have lots of
modules in the 1.2 ROM but, at power up, several of these modules are
installed into ram which cuts down your available memory. Exactly which
ones are installed is set by various bytes in the CMOS ram. To find out
what all the modules are and whether they are actually active, type
*ROMModules. (or just *ROM. for short.) You can “unplug” the modules by
using *UNPLUG <modulename> and it stays unplugged until you “insert” it
again with *RMREINIT <modulename>. It seems that the extra space does
not become available until you press <ctrl-break>. If you type *UNPLUG
without a module name it tells you which modules are currently
unplugged.
1.05
• HowÕs this for a screen dump? (sent in by Ken Yeardley) It is for
mode 0, it works on the NEC PC8023, it can be put on a function key and
it only takes 118 seconds.
1.05
VDU2,1,27,84,1,&31,1,&36: FOR
1.05
A%=&1FDCFB0 TO &1FDCFFF:VDU2,
1.05
1,27,83,1,&30,1,&35,1,&31,1,&32:
1.05
FOR B%=A% TO A%-20400 STEP-&50:
1.05
VDU1,?B%,1,?B%: NEXT: VDU1,10:
1.05
NEXT: VDU3
1.05
The reason it is so short is that the NEC printer has the MSB and LSB of
the byte that defines which pins hit the paper, the opposite way round
from Epson printers. (See page 9 for a sample screendump.
1.05
• Beware the microwave! One reader was having problems with data
corruption on the RS423 but it turned out to be only when his wife was
using the microwave oven four yards away, the other side of a brick
wall!
1.05
• HereÕs a little routine sent in by Mike Hobart which uses the
debugger module for disassembly and memory dumps. It doesnÕt quite rival
Toolkit, but itÕs a bit cheaper!
1.05
INPUT“Disassembly or Memory dump? (D/M)”,R$
1.05
CASE R$ OF
1.05
WHEN “d”,“D” : N%=FNi:REPEAT PROCx(“I”,N%,“ +10”):UNTIL FALSE
1.05
WHEN “m”,“M” : N%=FNi:REPEAT PROCx(“”,N%,“ +FF”):UNTIL FALSE
1.05
ENDCASE
1.05
END
1.05
DEFPROCx(S$,M%,L$)
1.05
WHILE INKEY(-99)
1.05
OS_CLI(“MEMORY”+S$+“ ”+
1.05
STR$~(N%)+L$)
1.05
N%=N%+100
1.05
ENDWHILE
1.05
ENDPROC
1.05
DEFFNi
1.05
INPUT“From(Address &nnnnnn)”‘N$
1.05
PRINT“Press <space> to scroll”
1.05
IF ASCN$<>ASC“&”THEN N$=“&”+N$
1.05
=EVAL N$
1.05
• Desktop on 1.2. (All the remaining H & T are based on material sent
in by Bruce Roberts.) As an alternative to double clicking on <select>
to open a file or run an application, try a single click on the adjust
button — it has the same effect.
1.05
The quick way to open a diary (or notepad), rather than opening the
diary window first and then pressing <menu>, is to double click on the
diary icon on the disk directory — the window opens automatically.
1.05
You can now save diaries and notepads with whatever name you like and
you can also click, or move with the cursor keys, and put text anywhere
in the window.
1.05
The following keys can now be used on diary and notepad:
1.05
<insert> Insert single character
1.05
<copy> Delete character to the right of
1.05
the cursor
1.05
<ctrl-insert> Insert a line above the cursor
1.05
<ctrl-copy> Delete a line
1.05
<shift-left/right> Move 4 characters sideways
1.05
<ctrl-left/right> Move to the end of the line
1.05
Notepads can be created from within View by saving a file (up to 100
lines, 78 characters wide) and then doing a *SETTYPE <filename> &FEE.
Existing notepads can be edited with View provided you use READ
<filename> instead of LOADing it and WRITE <filename> instead of SAVEing
it.
1.05
• After using the desktop, the function keys do not produce the normal
programmable strings or ASCII values. It seems that this is because
Acorn have not stuck to their own rules (see ProgrammersÕ Reference
Manual, page 488) because they do not call SWI Wimp_ CloseDown. The
“fix” published elsewhere of typing *FX225,1 is fine if you only want to
restore the strings to f0 - f9. To get f10 - f12 back, you need *FX221,1
but the simplest thing seems to be to make sure that everything is back
to its default setting by using a program, perhaps called QUIT, which
you can run from the desktop instead of clicking on the exit icon. To
set the default of all the combinations of <ctrl> and <shift> with all
the function keys, you need:
1.05
*FX225,1
1.05
*FX226,&80
1.05
*FX227,&90
1.05
*FX228,0
1.05
*FX221,1
1.05
*FX222,&D0
1.05
*FX223,&E0
1.05
*FX224,&F0
1.05
MODE 0
1.05
*BASIC
1.05
If you donÕt put in a MODE statement, youÕll find yourself typing
invisibly! The *BASIC means you come out into BASIC but with no program
in memory.
1.05
As an alternative, you could miss out the call to BASIC and put:
1.05
W%=GET
1.05
*MOUNT
1.05
*!BOOT
1.05
The idea would be that you would click on this program, change to the
disc you want to boot up, and press a key. You may want to include a
prompt to the user to “replace disc and press space bar” or somesuch.
The use of *!BOOT means that it doesnÕt matter if the boot file should
be *EXECed or *RUN — either will be done by the *!BOOT according to the
file type.
1.05
• Avoiding the desktop. If you don’t want to go into the desktop every
time you switch on or press <ctrl-break>, do a *CONFIGURE LANGUAGE 4 and
press <ctrl-break>. When you want to go into the desktop, type *DESKTOP
or *DES. for short. If you change your mind, *CON. LANG. 3 will bring
you into desktop at switch on or LANG. 0 will start you in the super
visor mode.
1.05
• View boot file. Here is a more sophisticated boot file than the one
we gave originally:
1.05
*ECHO<22><3>
1.05
*| selects mode 3
1.05
*GOS
1.05
*65ARTHUR
1.05
*GO F800
1.05
*LOAD VIEW 8000
1.05
*GO 8000
1.05
*ECHO<19><0><16><48><48><240>
1.05
*| sets background colour
1.05
*ECHO<19><1><16><240><240><208>
1.05
*| sets foreground colour
1.05
*ECHO<19><2><24><240><128><0>
1.05
*| sets border/line colour
1.05
SET FI
1.05
*| sets Format and Insert modes
1.05
NEW
1.05
• Avoiding *MOUNT. To avoid typing *MOUNT each time you put a new disc
in the drive, you can set an alias with, for example, *SET ALIAS$? MOUNT
| M CAT so that when you type *?<return> it does the mount and the
catalogue all in one.
1.05
• Centronics GLP screendump. The *HardCopyMX nearly works because the
printer is Epson-compatible-ish! All you need to do is issue, from
BASIC, the following codes:
1.05
VDU2,1,27,1,65,1,8,1,27,1,50,3